﻿using System;
using System.Collections.Generic;
using System.Text;
using static xiaodingmarket_Domain.Models.EunmType;

namespace xiaodingmarket_Domain.Commands
{
    public class UpdateCommodityCommand : CommodityCommand
    {
        public UpdateCommodityCommand(Guid id, Kind? kind, Category category, DateTime endtime, string remark, Guid commodityId, string detile, string title, decimal price, DateTime modifyTime, Commoditystate state)
        {
            Id = id;
            Kind = kind;
            Category = category;
            this.endtime = endtime;
            Remark = remark;
            CommodityId = commodityId;
            Detile = detile;
            Title = title;
            Price = price;
            State = state;
        }
        //只修改状态的时候用
        public UpdateCommodityCommand(Guid id, Commoditystate state)
        {
            CommodityId = id;
            State = state;
        }
        public UpdateCommodityCommand()
        {

        }
        /// <summary>
        /// 品目分类
        /// </summary>
        public Category? Category { get; set; }
        /// <summary>
        /// 设定的自动截止时间,普通商品默认为无期
        /// </summary>
        public DateTime? endtime { get;  set; }
        /// <summary>
        /// 备注（用户自定义标签等）)
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 商品id
        /// </summary>
        public Guid CommodityId { get;  set; }
        /// <summary>
        /// 商品详情
        /// </summary>
        public string Detile { get; set; }
        /// <summary>
        /// 商品标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 商品价格
        /// </summary>
        public decimal? Price { get; set; }
        /// <summary>
        /// 商品状态
        /// </summary>
        public Commoditystate? State { get; set; }
        /// <summary>
        /// 修改人id(用来存放最终审核人信息（因为举报功能可能会有多次审核）)
        /// </summary>
        public Guid ModifyId { get; set; }
        public override bool IsValid()
        {
            return true;
        }
    }
}
